package main

import (
	"fmt"
	"net"
	"net/rpc"
	"net/rpc/jsonrpc"
)

func main() {

	conn, err := net.Dial("tcp", ":8888")
	if err != nil {
		fmt.Println(1)
		panic(err.Error())
	}
	client := rpc.NewClientWithCodec(jsonrpc.NewClientCodec(conn))
	var reply string
	err = client.Call("hhh.Hello", "world", &reply)
	if err != nil {
		fmt.Println(2)
		panic(err.Error())
	}
	fmt.Println(reply)

}
